Introduction to TicketmasterR

Aamna Amer, Jason Samuel Suwito, Kelsey Strachan

About the Package

TicketmasterR is an R wrapper package for the Ticketmaster API

This API offers access to content from various platforms, including Ticketmaster, Universe, FrontGate Tickets, and Ticketmaster Resale (TMR), with events from all sources returned by default. With coverage of over 230k events across countries like the United States, Canada, Mexico, Australia, New Zealand, the United Kingdom, Ireland, and other European nations, the API continuously adds more events and expands to additional countries.

This R package implements the Discovery API, provides functions to interact with the Ticketmaster API, allowing users to fetch and analyze event data, retrieve ticket prices, and visualize event trends.

Users are encouraged to sign up for their own API key

Package Install

‘TicketmasterR’ is available on Github:

devtools::install_github("aamna-amer/TicketmasterR")

Note: To use this package, you need to set your Ticketmaster API key as an environment variable.

Sys.setenv(TICKETMASTER_API_KEY = "your_api_key_here")

get_ticketmaster_api_key() allows for easy access of your key.

Load the Package

library(TicketmasterR)

To access the documentation for the entire package, you can run the following command in your R console:

help(package = "TicketmasterR")

This will show a list of all the functions available to you.

You can also view documentation for a specific function by typing ?function_name in the R console. For example, if you wanted to view documentation for get_venue_info(), you would run:

?get_venue_info()

Fetch Data

Load in your key:

api_key <- get_ticketmaster_api_key()

get_full_ticketmaster_data(city, classification_name, sort_by, size) retrieves and processes event data from the Ticketmaster API and returns a cleaned data frame with event details. Passing no parameters will just return the last 200 events. Parameters are optional and include city (character string specifying a city to filter events), classification_name (character string to filter by event classification), sort_by (character string specifying sorting order), and size (number of results to return). See documentation for more details.

events_df <- get_full_ticketmaster_data()
head(events_df)
#>                               Event_Name         Event_ID       Date     Time
#> 1      SACRAMENTO KINGS VS. PHOENIX SUNS    G5vYZb2n_2V2d 2025-04-13 12:30:00
#> 2 Phoenix Suns vs. Golden State Warriors  1A_Zk7FGkdNASQV 2025-04-08 19:00:00
#> 3       Phoenix Suns vs. Milwaukee Bucks  1A_Zk7FGkdNeNQl 2025-03-24 19:00:00
#> 4     Phoenix Suns vs. San Antonio Spurs  1A_Zk7FGkdNFdQD 2025-04-11 19:00:00
#> 5       Milwaukee Bucks vs. Phoenix Suns vv1kjZb8ffG7XS3c 2025-04-01 19:00:00
#> 6 Phoenix Suns vs. Oklahoma City Thunder  1A_Zk7FGkdN6dQz 2025-04-09 19:00:00
#>                                   Venue       City      State
#> 1                       Golden 1 Center Sacramento California
#> 2 PHX Arena (formerly Footprint Center)    Phoenix    Arizona
#> 3 PHX Arena (formerly Footprint Center)    Phoenix    Arizona
#> 4 PHX Arena (formerly Footprint Center)    Phoenix    Arizona
#> 5                          Fiserv Forum  Milwaukee  Wisconsin
#> 6 PHX Arena (formerly Footprint Center)    Phoenix    Arizona
#>                    Country Min_Price Max_Price
#> 1 United States Of America        40      4000
#> 2 United States Of America        94      8250
#> 3 United States Of America        49      5250
#> 4 United States Of America        54      5250
#> 5 United States Of America        20      3750
#> 6 United States Of America        60      5250
#>                                                                                                              Ticket_Url
#> 1 https://www.ticketmaster.com/sacramento-kings-vs-phoenix-suns-sacramento-california-04-13-2025/event/1C0060FA993F43C3
#> 2  https://www.ticketmaster.com/phoenix-suns-vs-golden-state-warriors-phoenix-arizona-04-08-2025/event/19006108E31736B4
#> 3        https://www.ticketmaster.com/phoenix-suns-vs-milwaukee-bucks-phoenix-arizona-03-24-2025/event/19006108E30A36AB
#> 4      https://www.ticketmaster.com/phoenix-suns-vs-san-antonio-spurs-phoenix-arizona-04-11-2025/event/19006108E32036BB
#> 5    https://www.ticketmaster.com/milwaukee-bucks-vs-phoenix-suns-milwaukee-wisconsin-04-01-2025/event/0700610514FB34AD
#> 6  https://www.ticketmaster.com/phoenix-suns-vs-oklahoma-city-thunder-phoenix-arizona-04-09-2025/event/19006108E31C36B8
#>        Genre Segment
#> 1 Basketball  Sports
#> 2 Basketball  Sports
#> 3 Basketball  Sports
#> 4 Basketball  Sports
#> 5 Basketball  Sports
#> 6 Basketball  Sports

Event Analysis

While there are individual functions for analysis, print_ticketmaster_analysis(events_df) will provide a summary of key event and ticket statistics:

print_ticketmaster_analysis(events_df)
#> Venue with the most events: Yankee Stadium 
#> Venue with the least events: Ball Arena 
#> Event with the highest ticket price: Los Angeles Lakers vs. Golden State Warriors at $ 8840 
#> Event with the lowest ticket price: Portland Trail Blazers vs. Washington Wizards at $ 8

Event-based Analysis and Visuals

If we want to visualize the number of events by event type, we can do so by calling:

event_class_plot(events_df)

We can even visualize the average ticket price based on event type by calling:

avg_price_class_plot(events_df)

Ticket-based Analysis and Visuals

If we are interested in the distribution of average ticket prices, the following function will do so:

event_price_count_plot(events_df)

We can visualize the trend of the average ticket price as well by calling:

avg_event_price_line_plot(events_df)

Time-based Analysis and Visuals

Finally, we can plot the event count distribution by the hour:

event_hourly_distribution_plot(events_df)

Additionally, we can plot this distribution by day of the week:

event_day_distribution_plot(events_df)

Rate Limit

The Discovery API key is issued with 5000 API calls per day, with a rate limit imposed of 5 requests per second